import os
from pathlib import Path

import pandas as pd

from StressAna.Lib.Log.Log import Log

TUNNEL = []
LABEL = []
STATION = []
ANKESTATION = []
SELECT_DATE = []

FOLDPATH = ''
ANEKFOLDPATH = 'C:\\Users\\11509\\Desktop\\TD\\'
TITLE = '5305轨道顺槽数据对比'  # 运输   轨道
SAVE_PATH = "C:\\Users\\11509\\Desktop\\20240126\\c\\3-1\\"  # 图片保存路径

SAMP = 0  # 0-原始采样，1-分钟采样，2-小时采样
COPY = 0  # 小于等于0的数据是否替换为上一个，值为1开启
ANKE = 0  # 是否选择了安科数据，缺省为0

'''
#########################文件路径###########################
'''
def get_main_root_path():
    for ipath in Path(__file__).parents:
        if ipath.name == 'StressAna':
            return ipath
    # D:\monitorMain\Libs\Model\StructManager.py
    return Path(__file__).parent.parent.parent

PROJECT_PATH = get_main_root_path()
CONFIG_PATH = os.path.join(PROJECT_PATH, 'Config', 'config.ini')
DATA_PATH = os.path.join(PROJECT_PATH, 'Data')
DOC_PATH = os.path.join(PROJECT_PATH, 'Doc')
DB_PATH = os.path.join(PROJECT_PATH, 'Data', 'database.db')
'''
#########################日志对象全局变量###########################
'''
LOG = Log()
'''###########数据库参数##########'''
MYSQL_HOST = '192.168.86.246'  # 系统数据库地址
MYSQL_PORT = 3306  # 系统数据库端口
MYSQL_DB = 'stress'  # 系统数据库名称
MYSQL_USER = 'sysop'  # 系统数据库帐号
MYSQL_PASSWORD = 'sysop'  # 系统数据库密码

'##################LABEL_Structure#####################'
VIEW_SELECT = []
STATION_dict = ['G01-1', 'G01-2', 'G02-1', 'G02-2', 'G03-1', 'G03-2', 'G04-1', 'G04-2', 'G05-1', 'G05-2', 'G06-1',
                'G06-2',
                'G07-1', 'G07-2', 'G08-1', 'G08-2', 'G09-1', 'G09-2', 'G10-1', 'G10-2', 'G11-1', 'G11-2', 'G12-1',
                'G12-2',
                'Y01-1', 'Y01-2', 'Y02-1', 'Y02-2', 'Y03-1', 'Y03-2', 'Y04-1', 'Y04-2', 'Y05-1', 'Y05-2', 'Y06-1',
                'Y06-2',
                'Y07-1', 'Y07-2', 'Y08-1', 'Y08-2', 'Y09-1', 'Y09-2', 'Y10-1', 'Y10-2', 'Y11-1', 'Y11-2', 'Y12-1',
                'Y12-2',
                'J01-1', 'J01-2', 'J02-1', 'J02-2', 'J03-1', 'J03-2', 'J04-1', 'J04-2', 'J05-1', 'J05-2', 'J06-1',
                'J06-2',
                'J07-1', 'J07-2', 'J08-1', 'J08-2']  # 台站
nid_list = [13, 13, 22, 22, 28, 28, 26, 26, 24, 24, 4, 4, 2, 2, 31, 31, 21, 21, 17, 17, 12, 12, 23, 23, 18, 18, 30, 30,
            35, 35, 8, 8, 33, 33, 34, 34, 32, 32, 3, 3, 19, 19, 6, 6, 29, 29, 10, 10, 27, 27, 1, 1, 16, 16, 9, 9, 5, 5,
            11, 11, 14, 14, 25, 25]
STATION_CD = ['300mm', '300mm', '300mm', '300mm', '600mm', '600mm', '600mm', '600mm', '300mm', '300mm', '300mm', '300mm'
    , '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '600mm', '600mm', '600mm', '600mm'
    , '300mm', '300mm', '300mm', '300mm', '600mm', '600mm', '600mm', '600mm', '300mm', '300mm', '300mm', '300mm'
    , '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '600mm', '600mm', '600mm', '600mm'
    , '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm', '300mm'
    , '600mm', '600mm', '600mm', '600mm']  # 长度
STATION_BH = ['1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.5mm', '1.5mm', '1.5mm', '1.5mm', '1.2mm', '1.2mm', '1.2mm',
              '1.2mm',
              '1.5mm', '1.5mm', '1.5mm', '1.5mm', '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.5mm', '1.5mm', '1.5mm',
              '1.5mm',
              '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.5mm', '1.5mm', '1.5mm', '1.5mm', '1.2mm', '1.2mm', '1.2mm',
              '1.2mm',
              '1.5mm', '1.5mm', '1.5mm', '1.5mm', '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.5mm', '1.5mm', '1.5mm',
              '1.5mm',
              '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.2mm', '1.5mm', '1.5mm', '1.5mm',
              '1.5mm',
              '1.5mm', '1.5mm', '1.5mm', '1.5mm']  # 壁厚
STATION_KS = ['8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m',
              '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m',
              '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m',
              '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m',
              '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m', '8m', '10m', '14m', '20m',
              '8m', '10m', '14m', '20m']  # 孔深
STATION_CSY = ['5.23MPa', '5.24MPa', '5.34MPa', '5.45MPa', '4.80MPa', '5.05MPa', '4.80MPa', '4.80MPa', '8.01MPa',
               '8.10MPa', '8.23MPa', '8.26MPa', '8.35MPa', '8.08MPa', '7.85MPa', '7.80MPa', '9.94MPa', '10.26MPa',
               '10.48MPa', '10.17MPa', '9.88MPa', '9.45MPa', '9.98MPa', '9.86MPa', '5.66MPa', '5.38MPa', '5.62MPa',
               '5.27MPa', '5.43MPa', '5.32MPa', '5.58MPa', '5.15MPa', '7.70MPa', '6.8MPa', '7.93MPa', '7.96MPa',
               '7.96MPa', '8.11MPa', '7.71MPa', '8.59MPa', '10.81MPa', '10.00MPa', '9.71MPa', '10.45MPa', '10.20MPa',
               '9.78MPa', '9.70MPa', '10.29MPa', '5.17MPa', '5.26MPa', '5.29MPa', '4.99MPa', '8.27MPa', '8.09MPa',
               '7.96MPa', '8.12MPa', '10.03MPa', '10.28MPa', '10.13MPa', '10.06MPa', '5.36MPa', '5.08MPa', '5.15MPa',
               '5.00MPa']  # 初始压
STATION_ANKE = {51: '10', 163: '11', 164: '12', 165: '13', 166: '14', 167: '15', 142: '51', 152: '61', 153: '62',
                154: '63', 155: '64',
                156: '65', 233: '74', 237: '75', 242: '76', 245: '77'}

COLUMNS = ['sID', 'time', 'ch1', 'ch2', 'temp', 'power']

LABELS_DICT = pd.DataFrame()
